<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>已登记楼层管理</title>
	<meta name="decorator" content="default"/>

	<script src="${ctxStatic}/colorpick/jQueryColorPicker.min.js" type="text/javascript"></script>
	<script src="${ctxStatic}/colorpick/jqColor.js" type="text/javascript"></script>

	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('<spring:message code="common.subbmiting"/>');
                    timeVali($("#btnSubmit"));
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
            var $myColorPicker1 = $("input[name='fgcolor']").colorPicker({
                customBG: '#222',
                memoryColors:memoryColors,
                size: 3,
                readOnly: true,
                init: function(elm, colors) {
                    elm.style.backgroundColor = setBackgroundColor(elm.value);
                    elm.style.color = colors.rgbaMixCustom.luminance > 0.22 ? '#222' : '#ddd';
                },
                displayCallback: function(colors, mode, options) {
                    setInputColor($(options.input), colors);
                }
            });
            var $myColorPicker2 = $("input[name='bgcolor']").colorPicker({
                customBG: '#222',
                memoryColors:memoryColors,
                size: 3,
                readOnly: true,
                init: function(elm, colors) {
                    elm.style.backgroundColor = setBackgroundColor(elm.value);
                    elm.style.color = colors.rgbaMixCustom.luminance > 0.22 ? '#222' : '#ddd';
                },
                displayCallback: function(colors, mode, options) {
                    setInputColor($(options.input), colors);
                }
            });

            /*$("input[name='fgcolor']").colpick({
                layout:'hex',
                submit:0,
                colorScheme:'dark',
                onChange:function(hsb,hex,rgb,el,bySetColor) {
                    $(el).css('border-color','#'+hex);
                    if(!bySetColor){
                        $(el).val('#'+hex);
                    }
                }
            }).keyup(function(){
                $(this).colpickSetColor(this.value);
            });
            $("input[name='bgcolor']").colpick({
                layout:'hex',
                submit:0,
                colorScheme:'dark',
                onChange:function(hsb,hex,rgb,el,bySetColor) {
                    $(el).css('border-color','#'+hex);
                    if(!bySetColor){
                        $(el).val('#'+hex);
                    }
                }
            }).keyup(function(){
                $(this).colpickSetColor(this.value);
            });*/
		});
	</script>
</head>
<body>
<ul class="nav nav-tabs">
	<li><a href="${ctx}/source/floor/eleSourceFloored/">
		<spring:message code="floored.list"/>
	</a>
	</li>
	<li class="active">
		<a href="${ctx}/source/floor/eleSourceFloored/form?id=${eleSourceFloored.id}">
			
			<shiro:hasPermission name="source:floor:eleSourceFloored:edit">
				<c:if test="${not empty eleSourceFloored.id}">
						<spring:message code="floored.modify"/>
					</c:if>
					<c:if test="${empty eleSourceFloored.id}">
						<spring:message code="floored.add"/>
					</c:if>
			</shiro:hasPermission>
			<shiro:lacksPermission name="source:floor:eleSourceFloored:edit">
				<spring:message code="floored.info"/>
			</shiro:lacksPermission>
		</a>
	</li>
</ul>
<br/>
	<form:form id="inputForm" modelAttribute="eleSourceFloored" action="${ctx}/source/floor/eleSourceFloored/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label"><spring:message code="floored.name"/>：</label>
			<div class="controls">
				<form:input path="name" htmlEscape="false" maxlength="50" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code="floored.font.color"/>：</label>
			<div class="controls">
				<form:input path="fgcolor" htmlEscape="false" maxlength="100" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code="floored.background.color"/>：</label>
			<div class="controls">
				<form:input path="bgcolor" htmlEscape="false" maxlength="100" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code="floored.columns.number"/>：</label>
			<div class="controls">
				<form:input path="column" htmlEscape="false" maxlength="100" class="input-xlarge required digits"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code="floored.columns.width"/>：</label>
			<div class="controls">
				<form:input path="columnWidth" htmlEscape="false" maxlength="100" class="input-xlarge required digits"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code="floored.spacing.horizontal"/>：</label>
			<div class="controls">
				<form:input path="horizontalSpacing" htmlEscape="false" maxlength="100" class="input-xlarge required digits"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code="floored.spacing.vertical"/>：</label>
			<div class="controls">
				<form:input path="verticalSpacing" htmlEscape="false" maxlength="100" class="input-xlarge required 	digits"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<c:if test="${language == 'zh'}">
		<div class="control-group">
			<label class="control-label"><spring:message code="common.text.align"/>：</label>
			<div class="controls">
				<form:select path="align" >
					<form:options items="${fns:getDictList('textalign')}" itemLabel="label" itemValue="value" htmlEscape="false" class="input-small"/>
				</form:select>
			</div>
		</div>
		</c:if>
		<c:if test="${language == 'en'}">
		<div class="control-group">
			<label class="control-label"><spring:message code="common.text.align"/>：</label>
			<div class="controls">
				<form:select path="align" >
					<form:options items="${fns:getDictList('textalign')}" itemLabel="enlabel" itemValue="value" htmlEscape="false" class="input-small"/>
				</form:select>
			</div>
		</div>
		</c:if>
		<div class="control-group">
			<label class="control-label"><spring:message code="floored.font.size"/>：</label>
			<div class="controls">
				<form:input path="size" htmlEscape="false" maxlength="11" class="input-xlarge required 	digits"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code="common.remarks"/>：</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="input-xxlarge "/>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="source:floor:eleSourceFloored:edit">
				<input id="btnSubmit" class="btn btn-primary" type="submit" value="<spring:message code='common.save'/>"/>&nbsp;
			</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="<spring:message code='common.back'/>" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>